package com.jh.paymentchannel.repository;

import com.jh.paymentchannel.pojo.JFApiRegister;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;


@Repository
public interface JFApiRepository extends JpaRepository<JFApiRegister, String>, JpaSpecificationExecutor<JFApiRegister>{
	
	@Query("select jfapi from  JFApiRegister jfapi where jfapi.bankCard=:bankCard")
	public JFApiRegister	getJFApiRegisterByBankCard(@Param("bankCard") String bankCard);
	
	@Query("select jfapi from  JFApiRegister jfapi where jfapi.userId=:userId")
	public JFApiRegister	getJFApiRegisterByUserid(@Param("userId") long userId);
	
	//注销用户记录
	@Modifying
	@Query("delete from JFApiRegister jfapi where jfapi.userId=:userid")
	void delJFApiRegisterByUserid(@Param("userid") long userid);
}
